package com.tjetc.mapper;

import com.tjetc.domain.Parent;
import com.tjetc.vo.Result;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ParentMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Parent record);

    int insertSelective(Parent record);

    Parent selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Parent record);

    int updateByPrimaryKey(Parent record);

    Parent getParentByName(String username);
    @Select("select * from parents where username=#{username} and id=#{id}")
    Parent findByNameAPId(@Param("username") String username, @Param("id") Integer id);

    @Select("select * from parents where username=#{username} and password=#{password}")
    Parent findByName(@Param("username") String username,@Param("password") String password);


    @Update("update parents set password =#{password2}  where id=#{parentId};")
    Result updP(@Param("password2") String password2,@Param("parentId") int parentId);

    @Update("update parents set password =#{password2}  where id=#{parentId};")
    int updPa(@Param("password2")String password2,@Param("parentId") int parentId);
}